//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	FieldMapperCacheList.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;
using System.Collections.Generic;
using System.Linq;

namespace Smart.Common.Entities
{
	/// <summary>
	/// Entity Mapper Cache (entity fields)
	/// </summary>
	public class FieldMapperCacheList : List<FieldMapperCacheItem>
	{
		protected Dictionary<string, FieldMapperCacheItem> _dict;

		public virtual Dictionary<string, FieldMapperCacheItem> GetDictionary()
		{
			if (_dict == null)
				_dict = this.ToDictionary(item => item.FieldName, StringComparer.OrdinalIgnoreCase);

			return _dict;
		}
	}
}